In a state-of-the-art valve actuating mechanism of this type (EP-A 213 759 or GB-A-2199894) connection between the first and the second set of rocker arms in the higher speed range is effected by means of pistons displaceable by oil pressure which are mounted radially to the swivel axis of the rocker arms in bores provided in the rocker arms. The bores are aligned with each other when the rocker arms rest on the base circles of their cams. In the lower speed range, in which the valves are to be actuated by the cams associated with the first set of rocker arms, the frontal surfaces of the meeting pistons are situated in the division planes between the rocker arms, so that the valves are actuated exclusively by the first set of rocker arms and the second set of rocker arms can swing freely. In the upper speed range the pistons are displaced in such a way that they penetrate the division planes, with the result that the second set of rocker arms is connected to the first set of rocker arms and the valves are actuated by the second set of rocker arms as determined by the outline of the cams associated with the second set of rocker arms. Different valve lifts and different open periods can accordingly be produced in the higher and the lower speed ranges. One disadvantage of the state-of-the-art design is that in the lower speed range the frontal surfaces of the pistons continually slide into each other and that very high precision is required in manufacture of the pistons and the bores.